package com.itheima.mapper;

import com.itheima.pojo.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

@Mapper
public interface RoleMapper {
    /**
     * 根据角色id查询权限
     * @param id
     * @return
     */
    @Select("select * from t_permission where id in (select permission_id from t_role_permission where role_id=#{id})")
    Set<Permission> getPermissionsByRoleId(Integer id);
}
